Skip to content

Handle Byte scalar type in quantized conv2d NHWC (#18427)#18427

Open
khazaei wants to merge 2 commits intopytorch:mainfrom
khazaei:export-D97819850
Open

Handle Byte scalar type in quantized conv2d NHWC (#18427)#18427
khazaei wants to merge 2 commits intopytorch:mainfrom
khazaei:export-D97819850

Conversation

@khazaei
Copy link
Copy Markdown
Contributor

@khazaei khazaei commented Mar 23, 2026

Summary:

Extend the quantized conv2d NHWC operator to accept ScalarType::Byte (uint8) inputs in addition to ScalarType::Char (int8), enabling unsigned 8-bit quantized inference through the same HiFi code path.

Differential Revision: D97819850

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Mar 23, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18427

Note: Links to docs will display an error until the docs builds have been completed.

❌ 2 New Failures, 2 Unrelated Failures

As of commit 3757d54 with merge base 45a9717 (image):

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 23, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync bot commented Mar 23, 2026

@khazaei has exported this pull request. If you are a Meta employee, you can view the originating Diff in D97819850.

@github-actions
Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@meta-codesync meta-codesync bot changed the title Handle Byte scalar type in quantized conv2d NHWC Handle Byte scalar type in quantized conv2d NHWC (#18427) Mar 24, 2026
khazaei pushed a commit to khazaei/executorch that referenced this pull request Mar 24, 2026
Summary:

Extend the quantized conv2d NHWC operator to accept `ScalarType::Byte` (uint8) inputs in addition to `ScalarType::Char` (int8), enabling unsigned 8-bit quantized inference through the same HiFi code path.

Differential Revision: D97819850
khazaei pushed a commit to khazaei/executorch that referenced this pull request Mar 24, 2026
Summary:

Extend the quantized conv2d NHWC operator to accept `ScalarType::Byte` (uint8) inputs in addition to `ScalarType::Char` (int8), enabling unsigned 8-bit quantized inference through the same HiFi code path.

Differential Revision: D97819850
khazaei pushed a commit to khazaei/executorch that referenced this pull request Mar 24, 2026
Summary:
Pull Request resolved: pytorch#18427

Extend the quantized conv2d NHWC operator to accept `ScalarType::Byte` (uint8) inputs in addition to `ScalarType::Char` (int8), enabling unsigned 8-bit quantized inference through the same HiFi code path.

Differential Revision: D97819850
…ouped convolutions

Summary:
Rearrange weights from [OC, KH, KW] to [KH, KW, OC] for depthwise conv2d when `groups == input_channels` . The NNLib depthwise function (`xa_nn_conv2d_depthwise_per_chan_sym8sxasym8s`) expects weights in [KH, KW, OC] layout, but when the weight tensor is 4D [OC, KH, KW, IC/G], it arrives in [OC, KH, KW] order. A temporary buffer is allocated via `allocate_temp_memory` to hold the rearranged weights, which are then passed to the depthwise kernel instead of the original `p_kernel`.

Also updates `test_custom_ops.py` to target the `Artemis_HiFi4_UT_v3` backend.

Differential Revision: D97833420
khazaei pushed a commit to khazaei/executorch that referenced this pull request Mar 24, 2026
Summary:

Extend the quantized conv2d NHWC operator to accept `ScalarType::Byte` (uint8) inputs in addition to `ScalarType::Char` (int8), enabling unsigned 8-bit quantized inference through the same HiFi code path.

Differential Revision: D97819850
Summary:
Pull Request resolved: pytorch#18427

Extend the quantized conv2d NHWC operator to accept `ScalarType::Byte` (uint8) inputs in addition to `ScalarType::Char` (int8), enabling unsigned 8-bit quantized inference through the same HiFi code path.

Differential Revision: D97819850
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant